//
// Created by Jisam on 01/10/2024 5:25 PM.
// Solution of  b2
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
using namespace std;


signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int T;
    cin >>T;
    while(T --){
        int k,l = 1,r = 2e18;
        cin >> k ;
        while(l + 1 < r){
            int mid = (l + r ) >>1;
            (mid - signed(sqrtl(mid)) >= k ? r : l ) = mid;
        }
        cout << r << endl;
    }

    return 0;
}